package com.platform.modules.report.controller;


import com.platform.modules.report.dto.BaseItemDTO;
import com.platform.modules.report.dto.BrokenLineDTO;
import com.platform.modules.report.dto.CompanyRankingDTO;
import com.platform.modules.report.dto.QlyInsDistributeDTO;
import com.platform.modules.sys.controller.AbstractController;
import com.platform.web.utils.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@Api(tags = "报表 - 企业分析")
@RestController
@RequestMapping("report/company")
public class CompanyReportController extends AbstractController {

    @ApiOperation("各企业在建项目数排名 - 默认:表格")
    @PostMapping("prjCountInConstructionCompanyRanking")
    public CommonResult<List<CompanyRankingDTO>> prjCountInConstructionCompanyRanking(){
        List<CompanyRankingDTO> list = Arrays.asList(
                new CompanyRankingDTO("130100","恒大集团",999),
                new CompanyRankingDTO("130200","霄岭集团",888),
                new CompanyRankingDTO("130300","北京霄岭",777),
                new CompanyRankingDTO("130400","唐山霄岭",666),
                new CompanyRankingDTO("130500","万科集团",555),
                new CompanyRankingDTO("130600","碧桂园",444),
                new CompanyRankingDTO("130700","卓达",333),
                new CompanyRankingDTO("130800","融创",222),
                new CompanyRankingDTO("130900","久昌",111),
                new CompanyRankingDTO("131000","天山",110),
                new CompanyRankingDTO("131000","天山",110)
        );
        return CommonResult.success(list);
    }

    @ApiOperation("各市在建项目数排名 - 默认:表格")
    @PostMapping("prjCountUnderConstructionCityRanking")
    public CommonResult<List<CompanyRankingDTO>> prjCountUnderConstructionCityRanking(){
        List<CompanyRankingDTO> list = Arrays.asList(
                new CompanyRankingDTO("130100","石家庄",999),
                new CompanyRankingDTO("130200","唐山",888),
                new CompanyRankingDTO("130300","秦皇岛",777),
                new CompanyRankingDTO("130400","邯郸",666),
                new CompanyRankingDTO("130500","邢台",555),
                new CompanyRankingDTO("130600","保定",444),
                new CompanyRankingDTO("130700","张家口",333),
                new CompanyRankingDTO("130800","承德",222),
                new CompanyRankingDTO("130900","沧州",111),
                new CompanyRankingDTO("131000","廊坊",110),
                new CompanyRankingDTO("131100","衡水",109)
        );
        return CommonResult.success(list);
    }


    @ApiOperation("各企业年度项目数 - 折线")
    @PostMapping("yearPrjCountOfCompany")
    public CommonResult<List<BrokenLineDTO>> yearPrjCountOfCompany(){

        List<BaseItemDTO> list1 = Arrays.asList(
                new BaseItemDTO("2015","1000",""),
                new BaseItemDTO("2016","1100",""),
                new BaseItemDTO("2017","1200",""),
                new BaseItemDTO("2018","1300",""),
                new BaseItemDTO("2019","1400",""),
                new BaseItemDTO("2020","1500","")
        );

        List<BaseItemDTO> list2 = Arrays.asList(
                new BaseItemDTO("2015","600",""),
                new BaseItemDTO("2016","700",""),
                new BaseItemDTO("2017","800",""),
                new BaseItemDTO("2018","1600",""),
                new BaseItemDTO("2019","2400",""),
                new BaseItemDTO("2020","3000","")
        );

        List<BrokenLineDTO> list = Arrays.asList(
                new BrokenLineDTO("恒大",list1),
                new BrokenLineDTO("万科",list2)
        );

        return CommonResult.success(list);
    }







}
